package com.nobody.facepk.model;

import java.sql.Date;

import javax.persistence.Entity;
import javax.persistence.Table;
import javax.persistence.Transient;

import com.nobody.facepk.persist.VersionedPersistentSupport;
import com.nobody.facepk.service.ServiceRegistry;

@Entity
@Table(name="T_PICTURE")
public class Picture extends VersionedPersistentSupport{
	private Long userId;
	private String name;
	private String introduction;
	private String path;
	private int    sex;  //男 0  女 1 
	private Date createTime;
	private int score;
	private int scoreCount;
	private PictureState state;
	private int winTimes;
	private int loseTimes;
	
	public int getWinTimes() {
		return winTimes;
	}
	public void setWinTimes(int winTimes) {
		this.winTimes = winTimes;
	}
	public int getLoseTimes() {
		return loseTimes;
	}
	public void setLoseTimes(int loseTimes) {
		this.loseTimes = loseTimes;
	}
	public Long getUserId() {
		return this.userId;
	}
	public void setUserId(Long userId) {
		this.userId = userId;
	}
	public String getPath() {
		return this.path;
	}
	public void setPath(String path) {
		this.path = path;
	}
	public String getName() {
		return this.name;
	}
	public void setName(String name) {
		this.name = name;
	}
	public String getIntroduction() {
		return this.introduction;
	}
	public void setIntroduction(String introduction) {
		this.introduction = introduction;
	}
	public Date getCreateTime() {
		return this.createTime;
	}
	public void setCreateTime(Date createTime) {
		this.createTime = createTime;
	}
	public int getScore() {
		return this.score;
	}
	public void setScore(int score) {
		this.score = score;
	}
	public void setScoreCount(int voteCount) {
		this.scoreCount = voteCount;
	}
	public int getScoreCount() {
		return this.scoreCount;
	}
	public PictureState getState() {
		return state;
	}
	public void setState(PictureState state) {
		this.state = state;
	}
	public int getSex() {
		return sex;
	}
	public void setSex(int sex) {
		this.sex = sex;
	}
	
	@Transient
	public PictureData getPictureData(PictureDataType type) {
		return ServiceRegistry.getPictureService().getPictureData(this.getId(), type);
	}
}
